package cn.wolfcode.luowowo.shop.service.impl;

import cn.wolfcode.luowowo.shop.domain.ShopRoll;
import cn.wolfcode.luowowo.shop.domain.ShopStrategy;
import cn.wolfcode.luowowo.shop.mapper.ShopStrategyMapper;
import cn.wolfcode.luowowo.shop.query.ShopStrategyQuery;
import cn.wolfcode.luowowo.shop.service.IShopStrategyService;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
@Service
public class ShopStrategyServiceImpl implements IShopStrategyService {
    @Autowired
    private ShopStrategyMapper shopStrategyMapper;

    //分页
    @Override
    public PageInfo query(ShopStrategyQuery qo) {
        PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
        List<ShopStrategy> list = shopStrategyMapper.selectAll();
        return new PageInfo(list);
    }



    //找出热门的子攻略
    @Override
    public List<ShopStrategy> getHot() {

        return shopStrategyMapper.getHot();
    }


    //为es准备数据
    @Override
    public List<ShopStrategy> listByIdIsNull() {

        return shopStrategyMapper.selectByIdIsNull();
    }


    @Override
    public void saveOrUpdate(ShopStrategy shopStrategy) {

    }

    @Override
    public void delete(Long id) {

    }

    @Override
    public List<ShopStrategy> getTop3() {
        return null;
    }

}
